Conversation
AmericanPayoffAtExpiry drops the (H/S)^(2 mu) N(D2) term whenever N(D2) underflows to zero. At low volatility the power it multiplies is large enough that the product is not negligible: at vol 0.1%, r -2% and q 3%, a down-and-in put on a barrier at 95 paying 10 at expiry priced at 1.0002 against 1.0176. Where N(D2) underflows or the power overflows, the product is now formed in logs, with the asymptotic tail of log N. Over 1152 options with volatility from 10% down to 1e-6, master had 4 values more than 1e-6 away from the closed form in 50-digit arithmetic, up to 1.7%; with this change the largest difference is 1.6e-8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AmericanPayoffAtExpiry, whichAnalyticDigitalAmericanEngineuses for a payoff at expiry, setsY_to zero whenever N(D2) underflows. At low volatility the power (H/S)^(2 mu) that multiplies N(D2) is large enough that the product is not negligible. At vol 0.1%, r -2% and q 3%, a down-and-in put on a barrier at 95 paying 10 at expiry in one year prices at 1.0002, where the same formula in 50-digit arithmetic gives 1.0176.Where N(D2) underflows or the power overflows, the product is now formed in logs, with the asymptotic tail of log N where N underflows. Below the threshold at which the variance counts as zero nothing changes.
Over 1152 options with volatility from 10% down to 1e-6, master has 4 values more than 1e-6 away from the 50-digit closed form, the worst 1.7% off. With this change the largest relative difference is 1.6e-8.
testCashAtExpiryOrNothingAmericanLowVolatilitychecks four such cases and fails on master.DigitalOptionTestsand the full suite pass.The at-hit calculator has a related problem, which a separate pull request covers; the two touch different files.